﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace EcodexIntegrationSample.Forms
{
    public partial class frmObtenerTokenyHora : Form, View.IfrmObtenerTokenyHora
    {
        public frmObtenerTokenyHora()
        {
            InitializeComponent();
            var controller = new Controllers.frmObtenerTokenyHoraController(this);
        }

   

        public string RFCEmisor
        {
            get { return txtRFCEmisor.Text; }
        }

        public string Token
        {
            set { txtToken.Text = value; }
        }

        public string FechaHora
        {
            set { txtFechaHora.Text = value; }
        }

        public event EventHandler onObtenerToken;


        public void ShowSessionError(Entity.SessionError error)
        {
            MessageBox.Show(String.Format("Status {0}: {1}", error.Status.ToString(), error.Description), "Ecodex UniTest");
        }

        public void ShowUnknownError(String message)
        {
            MessageBox.Show(String.Format("Error: {0}", message), "Ecodex UniTest");
        }


        private void btnObtenerToken_Click(object sender, EventArgs e)
        {
            if (onObtenerToken != null)
                onObtenerToken(this, e);
        }
    }
}
